package com.fhj.movie.activity;

import java.util.ArrayList;
import java.util.List;

import com.fhj.movie.activity.HyyTasteActivity.MyAdapter;
import com.fhj.movie.fragment.HyyToturailFragment;
import com.fhj.movie.fragment.HyyToturailFragment1;
import com.fhj.movie.fragment.HyyToturailFragment2;
import com.fhj.movie.fragment.HyyWelcomeFragment3;
import com.fhj.movie_fhj_01.R;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;

public class HyyWelcomeActivity extends FragmentActivity {
	private ViewPager viewPager;
	private List<Fragment> fragment;
		@Override
		protected void onCreate(Bundle savedInstanceState) {
			// TODO Auto-generated method stub
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_welcome);
			viewPager=(ViewPager)this.findViewById(R.id.welcome_viewPager);
			fragment=new ArrayList<Fragment>();
			fragment.add(new HyyToturailFragment());
			fragment.add(new HyyToturailFragment1());
			fragment.add(new HyyWelcomeFragment3());
			MyAdapter adapter=new MyAdapter(getSupportFragmentManager());
			viewPager.setAdapter(adapter);
		}
		class MyAdapter extends FragmentPagerAdapter{

			public MyAdapter(FragmentManager fm) {
				super(fm);
				// TODO Auto-generated constructor stub
			}

			@Override
			public Fragment getItem(int arg0) {
				// TODO Auto-generated method stub
				return fragment.get(arg0);
			}

			@Override
			public int getCount() {
				// TODO Auto-generated method stub
				return fragment.size();
			}
		}
}
